home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / 1.2 / scripts / gimp-labels.scm.z / gimp-labels.scm
Text File  |  2002-07-08  |  7KB  |  161 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; www.gimp.org web labels
  4. ; Copyright (c) 1997 Adrian Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ; based on a idea by jtl (Jens  Lautenbacher)
  8. ; and improved by jtl
  9. ;
  10. ; This program is free software; you can redistribute it and/or modify
  11. ; it under the terms of the GNU General Public License as published by
  12. ; the Free Software Foundation; either version 2 of the License, or
  13. ; (at your option) any later version.
  14. ; This program is distributed in the hope that it will be useful,
  15. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ; GNU General Public License for more details.
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program; if not, write to the Free Software
  20. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. ;
  22. ;  **NOTE**  This fonts use some very common fonts, that are typically
  23. ;  bitmap fonts on most installations. If you want better quality versions
  24. ;  you need to grab the urw font package form www.gimp.org/fonts.html
  25. ;  and install as indicated. This will replace the some current bitmap fonts
  26. ;  with higher quality vector fonts. This is how the actual www.gimp.org
  27. ;  logos were created.
  28. ;
  29. ; ************************************************************************
  30. ; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
  31. ; For use with GIMP 1.1.
  32. ; All calls to gimp-text-* have been converted to use the *-fontname form.
  33. ; The corresponding parameters have been replaced by an SF-FONT parameter.
  34. ; ************************************************************************
  35.  
  36.  
  37. (define (script-fu-labels-gimp-org text font font-size text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
  38.   (let* ((img (car (gimp-image-new 125 height RGB)))
  39.      (text-layer (car (gimp-text-fontname img -1 xoff yoff text 0
  40.                      TRUE font-size PIXELS
  41.                      font)))
  42.      (bg-layer (car (gimp-layer-new  img 125 height
  43.                      RGB_IMAGE "Background" 100 NORMAL)))
  44.      (shadow-layer (car (gimp-layer-copy text-layer TRUE)))
  45.      (old-fg (car (gimp-palette-get-foreground)))
  46.      (old-bg (car (gimp-palette-get-background))))
  47.     
  48.     (gimp-image-undo-disable img)
  49.     (gimp-image-add-layer img shadow-layer 1)
  50.     (gimp-image-add-layer img bg-layer 2)
  51.     
  52.     (gimp-layer-set-preserve-trans text-layer TRUE)
  53.     (gimp-layer-set-preserve-trans shadow-layer TRUE)
  54.     
  55.     (gimp-palette-set-background text-color)
  56.     (gimp-edit-fill text-layer BG-IMAGE-FILL)
  57.  
  58.     (gimp-palette-set-background bg-color)
  59.     (gimp-edit-fill bg-layer BG-IMAGE-FILL)
  60.  
  61.     (gimp-palette-set-background shadow-color)
  62.     (gimp-edit-fill shadow-layer BG-IMAGE-FILL)
  63.     (gimp-layer-translate shadow-layer 1 1)
  64.  
  65.     (set! text-layer (car (gimp-image-flatten img)))
  66.     (gimp-layer-add-alpha text-layer)
  67.  
  68.     (if (= rm-bg TRUE)
  69.     (begin
  70.       (gimp-by-color-select text-layer bg-color
  71.                 color-thresh REPLACE TRUE FALSE 0 FALSE)
  72.       (gimp-edit-clear text-layer)
  73.       (gimp-selection-clear img)))
  74.     
  75.     (if (= index TRUE)
  76.        (gimp-convert-indexed img FS-DITHER MAKE-PALETTE num-colors FALSE FALSE ""))
  77.  
  78.     (gimp-palette-set-foreground old-fg)
  79.     (gimp-palette-set-background old-bg)
  80.     (gimp-image-undo-enable img)
  81.     (gimp-display-new img)))
  82.  
  83.  
  84. ;;;(define (script-fu-tube-button-label-gimp-org text rm-bg index)
  85. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 14 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 8 0 30))
  86. ;;;
  87. ;;;(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  88. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 12 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 7 0 24))
  89. ;;;  
  90. ;;;(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  91. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 10 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 6 0 18))
  92. ;;;
  93.  
  94. (define (script-fu-tube-button-label-gimp-org text rm-bg index)
  95.   (script-fu-labels-gimp-org text "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*" 14 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
  96.  
  97. (define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  98.   (script-fu-labels-gimp-org text "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*" 12 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
  99.   
  100. (define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  101.   (script-fu-labels-gimp-org text "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*" 10 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
  102.  
  103.  
  104. (script-fu-register "script-fu-tube-button-label-gimp-org"
  105.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Gimp.Org/Tube Button Label..."
  106.             "Tube Button Label Header for gimp.org"
  107.             "Adrian Likins & Jens Lautenbacher"
  108.             "Adrian Likins & Jens Lautenbacher"
  109.             "1997"
  110.             ""
  111.             SF-STRING _"Text" "?"
  112.             SF-TOGGLE _"Remove Background" TRUE
  113.             SF-TOGGLE _"Index Image" TRUE)
  114.  
  115. (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
  116.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Gimp.Org/Tube Sub-Button Label..."
  117.             "Tube Button Label Header for gimp.org"
  118.             "Adrian Likins & Jens Lautenbacher"
  119.             "Adrian Likins & Jens Lautenbacher"
  120.             "1997"
  121.             ""
  122.             SF-STRING _"Text" "?"
  123.             SF-TOGGLE _"Remove Background" TRUE
  124.             SF-TOGGLE _"Index Image" TRUE)
  125.  
  126. (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
  127.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Gimp.Org/Tube Sub-Sub-Button Label..."
  128.             "Tube Button Label Header for gimp.org"
  129.             "Adrian Likins & Jens Lautenbacher"
  130.             "Adrian Likins & Jens Lautenbacher"
  131.             "1997"
  132.             ""
  133.             SF-STRING _"Text" "?"
  134.             SF-TOGGLE _"Remove Background" TRUE
  135.             SF-TOGGLE _"Index Image" TRUE)
  136.  
  137.  
  138. (script-fu-register "script-fu-labels-gimp-org"
  139.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Gimp.Org/General Tube Labels..."
  140.             "Tube Button Label Header for gimp.org"
  141.             "Adrian Likins & Jens Lautenbacher"
  142.             "Adrian Likins & Jens Lautenbacher"
  143.             "1997"
  144.             ""
  145.             SF-STRING _"Text" "Gimp.Org"
  146.             SF-FONT   _"Font" "-*-helvetica-*-r-*-*-24-*-*-*-p-*-*-*"
  147.             SF-ADJUSTMENT _"Font Size (pixels)" '(18 2 1000 1 10 0 1)
  148.              SF-COLOR  _"Text Color" '(130 165 235)
  149.              SF-COLOR  _"Shadow Color" '(0 0 0)
  150.             SF-COLOR  _"Background Color" '(255 255 255)
  151.             SF-TOGGLE _"Remove Background" TRUE
  152.             SF-TOGGLE _"Index Image" TRUE
  153.             SF-ADJUSTMENT _"Number of Colors" '(15 2 255 1 10 0 1)
  154.             SF-ADJUSTMENT _"Select-By-Color Threshold" '(1 1 256 1 10 0 1)
  155.             SF-ADJUSTMENT _"Offset X" '(8 0 50 1 10 0 1)
  156.             SF-ADJUSTMENT _"Offset Y" '(0 0 50 1 10 0 1)
  157.             SF-ADJUSTMENT _"Height"   '(30 2 1000 1 10 0 1))
  158.